package com.wc.alorithm_luogu.P1725_琪露诺;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/15 13:02
 * @description https://www.luogu.com.cn/problem/P1725
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 200010, M = N << 1;
    static int[] f = new int[M];
    static int[] a = new int[M];
    static int[] q = new int[M];
    static int hh = 1, tt = 0;
    static int n, l, r;


    public static void main(String[] args) {
        n = sc.nextInt();
        l = sc.nextInt();
        r = sc.nextInt();
        for (int i = 0; i <= n; i++) a[i] = sc.nextInt();
        // 初始化跳的最远
        Arrays.fill(f, -0x3f3f3f3f);
        f[0] = 0;
        for (int i = l; i <= n; i++) {
            if (i - r > 0) pop(f[i - r - 1]);
            add(f[i - l]);
            f[i] = getMax() + a[i];
        }
        int res = Integer.MIN_VALUE;
        // 从 n - r + i跳出来
        for (int i = n - r + 1; i <= n; i++) {
            res = Math.max(res, f[i]);
        }
        out.println(res);
        out.flush();
    }

    static void add(int x) {
        while (tt >= hh && q[tt] < x) {
            tt--;
        }
        q[++tt] = x;
    }

    static int getMax() {
        return q[hh];
    }

    static void pop(int x) {
        if (q[hh] == x) {
            hh++;
        }
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
